home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 701 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  5.4 KB

  1. Subject: Re: Memory problems
  2. Date: Tue, 14 Dec 93 17:38:12 CET
  3. From: Juergen Lock <nox@jelal.north.de>
  4. In-Reply-To: <9312111941.AA22250@phlem.ph.kcl.ac.uk>; from "sjg@phlem.ph.kcl.ac.uk" at Dec 11, 93 7:41 pm
  5. Message-Id: <9312141638.AA00332@jelal.north.de>
  6.  
  7. sjg@phlem.ph.kcl.ac.uk writes:
  8.  
  9. > Is anyone else having the same problems with memory that I get running the
  10. > init suite of programs? 
  11. > When I run tcsh as the 'init' program from mint.cnf, I have something like 
  12. > 3.6Mb left over to play with. Not bad from the 4Mb it started from. The
  13. > problems come when I try the multi-user approach. When I log in having started:
  14. >     o init (and therefore update)
  15. >     o virtual consoles (4 of them - 4 getty's)
  16. >     o syslog
  17. >     o cron
  18. >     o lpd
  19. >     
  20. > and 1 tcsh on (say) vt01, I have 1.6Mb free(!!!).
  21.  
  22.  is that all free blocks (df /proc) or just the largest one? (Malloc(-1)...)
  23.  
  24. >  The memory usages of the 
  25. > programs (as given by ps) come to around 1.2Mb. That ought to give me over
  26. > 2.5Mb to play with. 
  27.  
  28.  also ps doesn't show everything, like kmalloc()d space (used by
  29. kernel, devices, filesystems...)  try ctrl-alt-f5, and (MiNT 1.09)
  30. ctrl-shift-alt-f5 (-> debug.c, mem.c, nalloc2.c).
  31. > Another thing is that when I run a tcsh on another terminal, and type 'mem'
  32. > the memory available has gone down (surprise :-), but when I press CTRL-D to
  33. > logout, and look at the memory available from the first terminal, it stays at
  34. > or about the level it was when 2 were running. Eventually I run out of memory.
  35.  
  36.  i don't know how tcsh's `mem' works, if its only the largest free block
  37. this doesn't have to be a real leak, maybe its `just' fragmentation...
  38. if you fix this, :)
  39.  
  40. Index: vcon.c
  41. @@ -86,15 +86,15 @@
  42.      if (cfd >= 0) {
  43.          /* try to uninstall gracefully... */
  44.          int opencnt = 0;
  45. -        char *vt00name=ttyname(cfd), *oldcname=ttyname(0), *s;
  46. +        char *vt00name, *oldcname, *s;
  47.          long vpgrp;
  48.  
  49.          /* /dev/vt00 might be renamed /dev/console... */
  50. -        if (vt00name && (s = strrchr (vt00name, '/')) &&
  51. +        if ((vt00name=ttyname(cfd)) && (s = strrchr (vt00name, '/')) &&
  52.              !strcmp (s, "/console"))
  53.              rename (vt00name, "u:/dev/vt00");
  54.          /* move original console device in place */
  55. -        if (oldcname && (s = strrchr (oldcname, '/')) &&
  56. +        if ((oldcname=ttyname(0)) && (s = strrchr (oldcname, '/')) &&
  57.              strcmp (s, "/console"))
  58.              rename (oldcname, "u:/dev/console");
  59.  
  60. you should be able to do a simple test:  login, go single user
  61. (SIGINT init, should shut down everything and give you a root sh,
  62. unless GEM was running... :( )  do a df /proc there, leave single user
  63. mode (exit sh) and do the same thing again.  i get the same result both
  64. times, if you don't maybe you can compare atrl-alt-f5 output and find
  65. the leak that way...
  66. > Presumably the memory used has not been reclaimed somewhere along the line, or
  67. > the free-memory management isn't working properly. Any fixes/ideas welocme :-)
  68.  
  69.  if your running 1.09, do you have the nalloc fixes installed?
  70.  
  71. ~Subject: nfree patch (memory fragmentation...)
  72. ~To: mint@terminator.rs.itd.umich.edu
  73. ~Date: Thu, 19 Aug 93 23:23:22 CES
  74. ~From: Juergen Lock <nox@jelal.north.de>
  75. ~X-Mailer: ELM [version 2.3/ST PL11]
  76. ~Message-Id: <9308192123.AA00114@jelal.north.de>
  77.  
  78. i just had it again, some memory chunk left in the middle of nowhere...
  79. looked again at the 1.09 diffs, hit ctrl-shift-alt-f5:
  80.  
  81. pid   4 (ksh): Arena at 1122A4 size 6000: free list:
  82. pid   4 (ksh):       112DC4 size        0
  83. pid   4 (ksh):       112E18 size        0
  84. pid   4 (ksh):       1133CA size        4
  85. pid   4 (ksh):       113468 size        8
  86. ...
  87. pid   4 (ksh): Arena at 1AC988 size 4000: free list:
  88. pid   4 (ksh):       1AC994 size     3FEC
  89.  
  90.  strange, a 4000 long area with 3fec free...  here's a patch :-)
  91.  
  92. --- nalloc2.c_    Tue Aug 17 18:36:30 1993
  93. +++ nalloc2.c    Thu Aug 19 21:46:12 1993
  94. @@ -239,7 +239,8 @@
  95.  
  96.      /* if, after coalescing, this arena is entirely free, Mfree it! */
  97.      if ((struct arena *)a->a_ffirst == a+1 && 
  98. -        (a->a_ffirst->b_size + sizeof(struct block)) == a->a_size) {
  99. +        (a->a_ffirst->b_size + sizeof(struct block) + sizeof(struct arena))
  100. +        == a->a_size && a != a_first) {
  101.          NALLOC_DEBUG('!');
  102.          *qa = a->a_next;
  103.  #if 1
  104.  
  105.  btw i later also found what looked like kmalloc'd pathnames of
  106. nonexisting files that the shell must have searched earlier...  is
  107. it tosfs that keeps them?  why? :-)
  108. ------------------------
  109. ~From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
  110. ~Date: Mon, 6 Sep 93 10:45:09 +0200
  111. ~Message-Id: <9309060845.AA20726@issan.informatik.uni-dortmund.de>
  112. ~Received: by issan.informatik.uni-dortmund.de id AA20726; Mon, 6 Sep 93 10:45:09 +0200
  113. ~Reply-To: schwab@ls5.informatik.uni-dortmund.de (Andreas Schwab)
  114. ~To: mint@atari.archive.umich.edu
  115. ~Subject: Bug in MiNT 1.09
  116.  
  117. There is a serious bug in kmalloc: when allocating a new arena for
  118. nalloc, the size passed to nalloc_add_arena is too big!
  119.  
  120. --- orig/util.c    Tue Aug 17 21:23:28 1993
  121. +++ util.c    Sat Sep  4 22:06:36 1993
  122. @@ -156,7 +156,7 @@
  123.          lp = (long *)m->loc;
  124.          *lp++ = (long)KMAGIC;
  125.          *lp++ = (long)m;
  126. -        nalloc_arena_add((void *)lp,KERMEM_SIZE);
  127. +        nalloc_arena_add((void *)lp,KERMEM_SIZE - 2*sizeof(long));
  128.          goto tryagain;
  129.          }
  130.      }
  131.  
  132.  and while your at it you could also increase the initial KERNEL_MEM
  133. (mem.h), i have it at 6*QUANTUM...
  134. > Simon.
  135.  may the source be with u :)
  136.     Juergen
  137. -- 
  138. J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
  139.                                 ...ohne Gewehr
  140. PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA 
  141.